package com.wx.generator;

import com.wx.generator.core.CodeGenerate;

import java.util.HashMap;
import java.util.Map;

/**
 * @author wx
 * @Description: 运行代码生成器入口
 * @date 2018/11/19 001916:29
 */
public class CodeGenerateMain {


    public static void main(String[] agrs) {
        Map<String, String> tableInfoMap = new HashMap<>();
        tableInfoMap.put("t_code", "单据编号");
        tableInfoMap.put("t_family", "家庭信息");
        tableInfoMap.put("t_finance_category", "财务类目表");
        run(tableInfoMap);
    }

    public static void run(Map<String, String> tableInfoMap) {
        tableInfoMap.forEach((tableName, tableDesc) -> {
            CodeGenerate codeGenerate = new CodeGenerate(tableName, tableDesc);
            try {
                codeGenerate.generate();
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }
        });
    }
}
